import java.util.Arrays;
/**
 * Created with Intellij IDEA
 * Description
 * User:ASUS
 * Date:2024-05-11
 * Time:21:26
 */
import java.util.Scanner;
public class Test {
    public static int[] transform(int[] array){
        int[] ret=new int[array.length];
        for(int i=0;i<array.length;i++){
            ret[i]=array[i]*2;
        }
        return ret;
    }

    public static void main(String[] args) {
        int[] array={1,2,3};
        int[] tmp=transform(array);
        System.out.println(Arrays.toString(array));
        System.out.println(Arrays.toString(tmp));
    }
        public static void main8(String[] args) {
            System.out.println("请输入一个值");
            Scanner scan=new Scanner(System.in);
            int n =scan.nextInt();
            char x='A';//初始
            char y='B';//中间
            char z='C';//目标
            digui(n,x,y,z );

        }
        //递归方法
        public static void digui(int i,char x,char y,char z){
            if(i==1){
                System.out.println(x+"——》"+z);
            }else{
                digui(i-1, x, z, y);
                System.out.println(x+"——》"+z);
                digui(i-1, y, x, z);
            }
        }

    public static int add1(int a,int b){
        return a+b;
    }
    public static float add2(float a,float b,float c){
        return a+b+c;
    }
    public static void main6(String[] args) {
        System.out.println(add1(2,8));
        System.out.println(add2(1,2,3));
    }
    public static int max2(int a,int b){
        return a>b?a:b;
    }
    public static float max4(float a,float b){
        return a>b?a:b;
    }
    public static float max3(float a,float b,float c){
        float max=max4(a,b);
        float ret=max4(max,c);
        return ret;
    }
    public static void main7(String[] args) {
        System.out.println(max2(1,2));
        System.out.println(max3(1,2,3));
    }

    public static void main5(String[] args) {
        System.out.println(max3(1,2,3));
    }
    public static void main4(String[] args) {
        int a=40;
        int b=20;
        int c=a%b;
        while(c!=0){
            a=b;
            b=c;
            c=a%b;
        }
        System.out.println(b);
    }
    public static void main3(String[] args) {
        int n=7;
        int count=0;
        while(n!=0){
            n=n&(n-1);
            count++;
        }
        System.out.println(count);
    }
    public static void main2(String[] args) {
     double sum=0;
     int flg=1;
     for(int i=1;i<=100;i++){
         sum=sum+1.0/i*flg;
         flg=-flg;
     }
        System.out.println(sum);
    }
    public static void main1(String[] args) {
        for(int i=0;i<999999;i++){
            int count=0;
            int tmp=i;
            while(tmp!=0){
                count++;
                tmp/=10;
            }
            tmp=i;
            int sum=0;
            while(tmp!=0){
                sum+=Math.pow(tmp%10,count);
                tmp/=10;
            }
            if(sum==i){
                System.out.println(i);
            }
        }
    }
}
